/**
 * 流失报警录入回访
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 客户流失报警录入回访数据查询
export const queryLossReturnVisit = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit`, {
  params
});

// queryLossVehicleTraceTaskByVin
export const queryLossVehicleTraceTaskByVin = vin => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/${vin}`);

// 客户流失问卷查询
export const findAllQuestion = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/findAll`, {
  params
});

// 客户流失问卷填写信息查询
export const questionnaireInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/questionnaire/${params.traceItemId}/${params.Questionaire}`);

// 回访历史--销售回访DCRC查询
export const querySales = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/sales`, {
  params
});

// 客户流失报警录入回访保存
export const saveLossReturnVisit = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/save`, params, {
  mark: types.SAVE
});

// 问卷明细--跟踪记录查询
export const queryTaskLog = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/taskLog`, {
  params
});

// 回访历史--回访历史查询
export const queryTrackTask = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/trackTask`, {
  params
});
// 回访历史-导出
export const getExcelList = params =>
  axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/lossReturnVisit/export`, {
    params,
    responseType: 'arraybuffer'
  });
